// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.util.util;

import java.util.NoSuchElementException;
import zombie.util.map.NoSuchMappingException;

public class Exceptions {
    public static void indexOutOfBounds(int index, int low, int high) throws IndexOutOfBoundsException {
        throw new IndexOutOfBoundsException("Index out of bounds: " + index + ", valid range is " + low + " to " + high);
    }

    public static void nullArgument(String name) throws NullPointerException {
        throw new NullPointerException("The specified " + name + " is null");
    }

    public static void negativeArgument(String name, Object value) throws IllegalArgumentException {
        throw new IllegalArgumentException(name + " cannot be negative: " + value);
    }

    public static void negativeOrZeroArgument(String name, Object value) throws IllegalArgumentException {
        throw new IllegalArgumentException(name + " must be a positive value: " + value);
    }

    public static void endOfIterator() throws NoSuchElementException {
        throw new NoSuchElementException("Attempt to iterate past iterator's last element.");
    }

    public static void startOfIterator() throws NoSuchElementException {
        throw new NoSuchElementException("Attempt to iterate past iterator's first element.");
    }

    public static void noElementToRemove() throws IllegalStateException {
        throw new IllegalStateException("Attempt to remove element from iterator that has no current element.");
    }

    public static void noElementToGet() throws IllegalStateException {
        throw new IllegalStateException("Attempt to get element from iterator that has no current element. Call next() first.");
    }

    public static void noElementToSet() throws IllegalStateException {
        throw new IllegalStateException("Attempt to set element in iterator that has no current element.");
    }

    public static void noLastElement() throws IllegalStateException {
        throw new IllegalStateException("No value to return. Call containsKey() first.");
    }

    public static void noSuchMapping(Object key) throws NoSuchMappingException {
        throw new NoSuchMappingException("No such key in map: " + key);
    }

    public static void dequeNoFirst() throws IndexOutOfBoundsException {
        throw new IndexOutOfBoundsException("Attempt to get first element of empty deque");
    }

    public static void dequeNoLast() throws IndexOutOfBoundsException {
        throw new IndexOutOfBoundsException("Attempt to get last element of empty deque");
    }

    public static void dequeNoFirstToRemove() throws IndexOutOfBoundsException {
        throw new IndexOutOfBoundsException("Attempt to remove last element of empty deque");
    }

    public static void dequeNoLastToRemove() throws IndexOutOfBoundsException {
        throw new IndexOutOfBoundsException("Attempt to remove last element of empty deque");
    }

    public static void nullElementNotAllowed() throws IllegalArgumentException {
        throw new IllegalArgumentException("Attempt to add a null value to an adapted primitive set.");
    }

    public static void cannotAdapt(String name) throws IllegalStateException {
        throw new IllegalStateException("The " + name + " contains values preventing it from being adapted to a primitive " + name);
    }

    public static void unsupported(String name) throws UnsupportedOperationException {
        throw new UnsupportedOperationException("Attempt to invoke unsupported operation: " + name);
    }

    public static void unmodifiable(String name) throws UnsupportedOperationException {
        throw new UnsupportedOperationException("Attempt to modify unmodifiable " + name);
    }

    public static void cloning() throws RuntimeException {
        throw new RuntimeException("Clone is not supported");
    }

    public static void invalidRangeBounds(Object first, Object last) throws IllegalArgumentException {
        throw new IllegalArgumentException("First (" + first + ") cannot be greater than last (" + last + ")");
    }

    public static void cannotMergeRanges(Object r1, Object r2) throws IllegalArgumentException {
        throw new IllegalArgumentException("Ranges cannot be merged: " + r1.toString() + " and " + r2.toString());
    }

    public static void setNoFirst() throws NoSuchElementException {
        throw new NoSuchElementException("Attempt to get first element of empty set");
    }

    public static void setNoLast() throws NoSuchElementException {
        throw new NoSuchElementException("Attempt to get last element of empty set");
    }

    public static void invalidSetBounds(Object low, Object high) throws IllegalArgumentException {
        throw new IllegalArgumentException("Lower bound (" + low + ") cannot be greater than upper bound (" + high + ")");
    }

    public static void valueNotInSubRange(Object value) throws IllegalArgumentException {
        throw new IllegalArgumentException("Attempt to add a value outside valid range: " + value);
    }

    public static void invalidUpperBound(Object value) throws IllegalArgumentException {
        throw new IllegalArgumentException("Upper bound is not in valid sub-range: " + value);
    }

    public static void invalidLowerBound(Object value) throws IllegalArgumentException {
        throw new IllegalArgumentException("Lower bound is not in valid sub-range: " + value);
    }
}
